package tothreedesignmodel.interpreter;

import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

/**
 * @author lzhphantom
 * @description
 * @date 创建于 9:54 2020/8/2
 * @modified
 */
public class TerminalExpression implements Expression {
    private final Set<String> set=new HashSet<>();
    public TerminalExpression(String[] data){
        set.addAll(Arrays.asList(data));
    }
    @Override
    public boolean interpret(String info) {
        return set.contains(info);
    }
}
